package com.cloud.api.domain.forward;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.cloud.api.utils.ExcelUtils;
import com.cloud.core.entity.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * <p>
 * 
 * </p>
 *
 * @author haohaibo
 * @since 2024-01-30
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("t_vehicle_forward_error")
@ExcelUtils.ExcelSheet(watermark = @ExcelUtils.Watermark(type = 0)
)
@Schema(name = "VehicleForwardError", description = "报文详情")
public class VehicleForwardError extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId("id")
    private String id;

    @TableField("vin")
    @ExcelUtils.ExcelExport(name = "table.field.vin")
    private String vin;

    @TableField("platform_id")
    private String platformId;

    @Schema(description = "服务器接受时间")
    @TableField("receive_time")
    @ExcelUtils.ExcelExport(name = "table.field.receiveTime")
    private LocalDateTime receiveTime;

    @Schema(description = "失败原因")
    @TableField("error_info")
    @ExcelUtils.ExcelExport(name = "table.field.errorInfo")
    private String errorInfo;

    @Schema(description = "报文类型")
    @TableField("command_type")
    @ExcelUtils.ExcelExport(name = "table.field.commandType",kvs = {
            @ExcelUtils.KV(k="1",v="登入"),
            @ExcelUtils.KV(k="2",v="实时"),
            @ExcelUtils.KV(k="3",v="补发"),
            @ExcelUtils.KV(k="4",v="登出")
    } )
    private String commandType;

    @Schema(description = "转发日期")
    @TableField("forward_date")
    private LocalDate forwardDate;

    @Schema(description = "车辆报文")
    @TableField("record")
    @ExcelUtils.ExcelExport(name = "table.field.record")
    private String record;
}
